package com.icez.domain.player

import android.os.Build
import androidx.annotation.RequiresApi
import kotlinx.coroutines.flow.StateFlow
import java.time.Duration

@RequiresApi(Build.VERSION_CODES.O)
val DefaultPlayerbackSpeed = Duration.ofSeconds(1)

data class EpisodePlayerState @RequiresApi(Build.VERSION_CODES.O) constructor(
    val currentEpisode: PlayerEpisode? = null,
    val queue: List<PlayerEpisode> = emptyList(),
    val playbackSpeed: Duration = DefaultPlayerbackSpeed,
    val isPlaying: Boolean = false,
    val timeElapsed:Duration = Duration.ZERO
)

interface EpisodePlayer {
    val playerState: StateFlow<EpisodePlayerState>

    var currentEpisode: PlayerEpisode?

    var playerSpeed: Duration

    fun addToQueque(episode: PlayerEpisode)


}